package com.ruoyi.stock2.mapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.stock2.domain.SearchFromEs;

/**
 * 从es中查询与模型相似股票Mapper接口
 *
 * @author ruoyi
 * @date 2021-09-08
 */
public interface SearchFromEsMapper
{
    /**
     * 查询从es中查询与模型相似股票
     *
     * @param id 从es中查询与模型相似股票ID
     * @return 从es中查询与模型相似股票
     */
    @DataSource(value = DataSourceType.SLAVE)
    public SearchFromEs selectSearchFromEsById(Long id);

    /**
     * 查询从es中查询与模型相似股票列表
     *
     * @param searchFromEs 从es中查询与模型相似股票
     * @return 从es中查询与模型相似股票集合
     */
    @DataSource(value = DataSourceType.SLAVE)
    public List<SearchFromEs> selectSearchFromEsList(SearchFromEs searchFromEs);

    /**
     * 新增从es中查询与模型相似股票
     *
     * @param searchFromEs 从es中查询与模型相似股票
     * @return 结果
     */
    @DataSource(value = DataSourceType.SLAVE)
    public int insertSearchFromEs(SearchFromEs searchFromEs);

    /**
     * 修改从es中查询与模型相似股票
     *
     * @param searchFromEs 从es中查询与模型相似股票
     * @return 结果
     */
    @DataSource(value = DataSourceType.SLAVE)
    public int updateSearchFromEs(SearchFromEs searchFromEs);

    /**
     * 删除从es中查询与模型相似股票
     *
     * @param id 从es中查询与模型相似股票ID
     * @return 结果
     */
    @DataSource(value = DataSourceType.SLAVE)
    public int deleteSearchFromEsById(Long id);


    @DataSource(value = DataSourceType.SLAVE)
    public int deleteSearchFromEsByByDate(Date createDate);

    /**
     * 批量删除从es中查询与模型相似股票
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @DataSource(value = DataSourceType.SLAVE)
    public int deleteSearchFromEsByIds(String[] ids);

    @DataSource(value = DataSourceType.SLAVE)
    public Map<String, Long> selectModelikeCount(SearchFromEs searchFromEs);

    @DataSource(value = DataSourceType.SLAVE)
    public List<Map<String, Object>> selectIndustryCount(SearchFromEs searchFromEs);

    @DataSource(value = DataSourceType.SLAVE)
    public List<Map<String, Object>> selectChooseCount(SearchFromEs searchFromEs);


}
